"""
sample:
{
    "_event_id": "bind",
    "_event_time": 1541786124,
    "user_id": 13284015,
    "ip": "111.193.5.27",
    "aid": "E7BBA6C1CA6BE70814A3A24D88CE1258",
    "chn": "aox_akinazs",
    "_id": 127
}
"""
EVENT_RULES = {
    "aggs": {
        "groups": [
            {
                "group_name": "渠道",
                "field_id": "_chn",
                "is_keyword": True,
                "field_name": "渠道"
            }
        ],
        "values": [],
        "uv": {
            "field_id": "_user_id",
            "field_name": "绑定人次"
        },
        "pv": {
            "field_name": "绑定次数"
        }
    }
}


EVENT_CONFIG = {
    "event_id": "bind",
    "event_name": "绑定事件",
    "values": {
        "_user_id": {
            "field_name": "用戶ID",
            "value_type": "long",
        },
        "_ip": {
            "field_name": "IP",
            "value_type": "string",
        },
        "_chn": {
            "field_name": "渠道",
            "value_type": "string"
        },
        "_aid": {
            "field_name": "设备ID",
            "value_type": "string"
        },
        "_cvc": {
            "field_name": "设备版本号",
            "value_type": "string",
            "required": False,
        },
        "_device_type": {
            "field_name": "设备类型, 0 web, 1 Android, 2 iOS",
            "value_type": "long",
            "required": False,
        },
        "_ua": {
            "field_name": "设备型号",
            "value_type": "string",
            "required": False,
        }
    },
    "rule": EVENT_RULES
}
